package com.itheima.design.mode.delegate;

import java.util.HashMap;
import java.util.Map;

public class Leader implements IExcuter {

    private Map<String,IExcuter> targets = new HashMap<String,IExcuter>();

    public Leader() {
        targets.put("加密",new ExcuterA());
        targets.put("登录",new ExcuterB());
    }

    @Override
    public void excuter(String command) {
        targets.get(command).excuter(command);
    }
}
